﻿
function selectTr(iobj, PageSize,selValue) {

    var io

    for (io = 0; io < document.forms[0].elements.length; io++) {
        var e = document.forms[0].elements[io];
        if (e.type == "checkbox") {
                e.checked = false;
        }
    }


    for (var i = 1; i <= PageSize; i++) {
        if (document.getElementById("tr_" + i) != null) {
            if (i == iobj) {//选中项
                document.getElementById("tr_" + i).className = "SelectTrCssName";
             
                var ii
                var icheck = 1;
                
                    for (ii = 0; ii < document.forms[0].elements.length; ii++)
                    {
                        var e = document.forms[0].elements[ii];
                        if (e.type == "checkbox" && e.id!="allbox" ) 
                        {
                            
                           
                            if (icheck == iobj)
                            {
                                e.checked = true;
                                break;
                            }
                            icheck = icheck + 1;
                        }
                    }
                

            }
            else {
                document.getElementById("tr_" + i).className = "unSelectTrCssName";

            }

        }
        else {
            break;
        }
    }

}

function SetTrbg(flag, trnum) {
    if (flag == 1) {
        //鼠标离开
        document.getElementById("li_" + trnum).className = "unSelectTrCssName";
    }
    else if (flag == 0) {
        //鼠标移动
        document.getElementById("li_" + trnum).className = "SelectTrCssName";
        
    }

}